home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / nt4.0 server / DRVLIB.NIC / MDGLEC / OEMSETUP.INF < prev   
INI File  |  1996-07-31  |  45KB  |  1,414 lines

  1. ;/****************************************************************************/
  2. ;/* Copyright (c) 1995 Madge Networks Ltd                                    */
  3. ;/****************************************************************************/
  4. ;
  5. ; OEMSETUP.INF
  6. ;
  7. ;       Madge LAN Emulation Client INF file.
  8. ;       v1.00
  9. ;
  10. ; History:
  11. ;       ACLC            25-Apr-1995     Created, based on OEMNADE2.INF
  12. ;       ACLC            12-May-1995     Extensive additions to create extra
  13. ;                                       service keys - they aren't perfect, but
  14. ;                                       they will do for now.
  15. ;       ACLC            23-May-1995     Added Ethernet option
  16. ;       ACLC            10-Oct-1995     Replaced all my hacks with calls into
  17. ;                                       external library functions, cleaning
  18. ;                                       up the code greatly!
  19. ;       ACLC            20-Nov-1995     Release!
  20. ;       ACLC            17-Jun-1996     New mod's for bugs in driver
  21. ;                                       dependencies and medium type changes.
  22. ;
  23. ;/****************************************************************************/
  24.  
  25. ;/****************************************************************************/
  26. ;/*                                                                          */
  27. ;/* Support sections for - Identify                                          */
  28. ;/*                                                                          */
  29. ;/****************************************************************************/
  30.  
  31. [Identification]
  32.     OptionType = NetAdapter
  33.  
  34.  
  35. ;/****************************************************************************/
  36. ;/*                                                                          */
  37. ;/* Mandatory section - Identify                                             */
  38. ;/*                                                                          */
  39. ;/****************************************************************************/
  40.  
  41. [Identify]
  42.     read-syms Identification
  43.  
  44.     set Status     = STATUS_SUCCESSFUL
  45.     set Identifier = $(OptionType)
  46.     set Media      = #("Source Media Descriptions", 1, 1)
  47.  
  48.     Return $(Status) $(Identifier) $(Media)
  49.  
  50.  
  51. ;/****************************************************************************/
  52. ;/*                                                                          */
  53. ;/* Support sections for - ReturnOptions                                     */
  54. ;/*                                                                          */
  55. ;/****************************************************************************/
  56.  
  57. [LanguagesSupported]
  58.     ENG
  59.  
  60.  
  61. [PlatformsSupported]
  62.     PCI
  63.  
  64.  
  65. [Options]
  66.     LEC
  67.  
  68.  
  69. ; OptionsTextENG - see language dependent sections
  70.  
  71.  
  72. ;/****************************************************************************/
  73. ;/*                                                                          */
  74. ;/* Mandatory section - ReturnOptions                                        */
  75. ;/*                                                                          */
  76. ;/****************************************************************************/
  77.  
  78. [ReturnOptions]
  79.     set Status         = STATUS_FAILED
  80.     set OptionList     = {}
  81.     set OptionTextList = {}
  82.  
  83.     ; Check if the language requested is supported
  84.  
  85.     set LanguageList = ^(LanguagesSupported, 1)
  86.  
  87.     Ifcontains(i) $($0) in $(LanguageList)
  88.         ; Check if the platforms requested is supported
  89.  
  90.         ifstr(i) $($1) == ""
  91.             goto returnoptions
  92.         endif
  93.  
  94.         set PlatformList = ^(PlatformsSupported, 1)
  95.  
  96.         Ifcontains(i) $($1) in $(PlatformList)
  97.             goto returnoptions
  98.         else
  99.             set Status = STATUS_NOTSUPPORTED
  100.             goto finish_ReturnOptions
  101.         endif
  102.     else
  103.         set Status = STATUS_NOLANGUAGE
  104.         goto finish_ReturnOptions
  105.     endif
  106.  
  107.     ; form a list of all the options and another of the text representing
  108.  
  109. returnoptions = +
  110.     set OptionList     = ^(Options, 1)
  111.     set OptionTextList = ^(OptionsText$($0), 1)
  112.     set Status         = STATUS_SUCCESSFUL
  113.  
  114. finish_ReturnOptions = +
  115.     Return $(Status) $(OptionList) $(OptionTextList)
  116.  
  117.  
  118. ;/****************************************************************************/
  119. ;/*                                                                          */
  120. ;/* Support sections for - InstallOption                                     */
  121. ;/*                                                                          */
  122. ;/****************************************************************************/
  123.  
  124. [GeneralConstants]
  125. ;
  126. ;  Program flow control variables.
  127. ;
  128. from      = ""
  129. to        = ""
  130. ;
  131. ;  Return codes; Exit_Code is set to one of these
  132. ;
  133. ExitCodeOk     = 0
  134. ExitCodeCancel = 1
  135. ExitCodeFatal  = 2
  136.  
  137. KeyNull            = ""
  138. MAXIMUM_ALLOWED    = 33554432
  139. RegistryErrorIndex = NO_ERROR
  140. KeyProduct         = ""
  141. KeyParameters      = ""
  142.  
  143. TRUE    = 1
  144. FALSE   = 0
  145. NoTitle = 0
  146.  
  147. ExitState = "Active"
  148. OldVersionExisted = $(FALSE)
  149.  
  150. DriverPath      = $(!STF_NTPATH)\drivers
  151.  
  152.  
  153. [FileConstants]
  154. ;
  155. ;  File names, etc.
  156. ;
  157. UtilityInf      = "UTILITY.INF"
  158. ParamInf        = "NCPARAM.INF"
  159. subroutineinf   = "SUBROUTN.INF"
  160. SoftwareType    = "driver"
  161. Exit_Code       = 0
  162.  
  163. ;
  164. ; EventLog Message File
  165. ;
  166. NetEventDLL     = "%SystemRoot%\System32\netevent.dll;%SystemRoot%\System32\atmcfg.dll"
  167.  
  168. ; Product Info
  169. ;
  170. Manufacturer        = "Madge"
  171. ProductMajorVersion = "3"
  172. ProductMinorVersion = "5"
  173. ProductVersion      = $(ProductMajorVersion)"."$(ProductMinorVersion)
  174. ;
  175. ; Software
  176. ;
  177. ProductSoftwareName      = "NtLec"
  178. ProductSoftwareImagePath = "%SystemRoot%\System32\drivers\NtLec.SYS"
  179. NetRuleSoftwareType      = "ntlecSys ndisDriver lecDriver"
  180. NetRuleSoftwareUse       = $(SoftwareType)
  181. NetRuleSoftwareBindForm  = """NtLec"" yes no container"
  182. NetRuleSoftwareClass     = {"lecDriver basic"}
  183. NetRuleSoftwareBindable  = {"lecDriver lecAdapter non exclusive 100"}
  184. ;
  185. ; Support drivers (well, actually, these do most of the work)
  186. ;
  187. ;AMUXSoftwareName      = AMUX
  188. ;AMUXSoftwareTitle     = "Madge ATM Multiplexer"
  189. ;AMUXSoftwareImagePath = %SystemRoot%\System32\drivers\AMUX.SYS
  190. ;AALSoftwareName       = SOKMAAL
  191. ;AALSoftwareTitle      = "Madge AAL Driver (SOK)"
  192. ;AALSoftwareImagePath  = %SystemRoot%\System32\drivers\SOKMAAL.SYS
  193.  
  194. ;
  195. ; Hardware
  196. ;
  197. ProductHardwareName      = "NtLec"
  198. NetRuleHardwareType      = "ntlec lecAdapter"
  199. NetRuleHardwareBindForm  = " yes yes container"
  200. NetRuleHardwareClass     = {"lecAdapter basic"}
  201. ;
  202. ; Registry Key
  203. ;
  204. ProductKeyName  = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  205. ParamKeyName    = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
  206. LinkageKeyName  = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Linkage"
  207.  
  208. [date]
  209.     ; Now is a list which contains { Sec from 1-1-1970, Year, Month, Day, Hour,
  210.     ; Minute, Second }
  211.     Now = {} ? $(!LIBHANDLE) GetSystemDate
  212.  
  213.  
  214. ;/****************************************************************************/
  215. ;/*                                                                          */
  216. ;/* Mandatory section - InstallOption                                        */
  217. ;/*                                                                          */
  218. ;/****************************************************************************/
  219.  
  220. [InstallOption]
  221.  
  222.     ; set !DebugOutputControl = 1
  223.  
  224.     set Status   = STATUS_FAILED
  225.  
  226.     ; extract parameters
  227.  
  228.     set Option   = $($1)
  229.     set SrcDir   = $($2)
  230.     set AddCopy  = $($3)
  231.     set DoCopy   = $($4)
  232.     set DoConfig = $($5)
  233.  
  234.     ; Check if the language requested is supported
  235.  
  236.     set LanguageList = ^(LanguagesSupported, 1)
  237.  
  238.     Ifcontains(i) $($0) NOT-IN $(LanguageList)
  239.         Return STATUS_NOLANGUAGE
  240.     endif
  241.  
  242.     set-subst LF = "\n"
  243.  
  244.     read-syms GeneralConstants
  245.     read-syms FileConstants
  246.     read-syms FileConstants$(!STF_LANGUAGE)
  247.     read-syms DialogConstants$(!STF_LANGUAGE)
  248.  
  249.     detect date
  250.  
  251.     set-title  $(FunctionTitle)
  252.  
  253.     set to   = Begin
  254.     set from = Begin
  255. ;
  256. ;  Assume all is well.
  257. ;
  258.     set CommonStatus = STATUS_SUCCESSFUL
  259.  
  260.     EndWait
  261.  
  262. ;
  263. ;   Set up the operation-mode-based variables and gaily welcome
  264. ;   the user.  If the "install mode" variable is improperly set,
  265. ;   assume this is a new installation.
  266. ;
  267.  
  268. Begin = +
  269.     Set ActivateDetection = FALSE
  270.  
  271.     Ifstr(i) $(!NTN_InstallMode) == deinstall
  272.         set StartLabel = removeadapter
  273.     else-Ifstr(i) $(!NTN_InstallMode) == update
  274.         set StartLabel = UpgradeSoftware
  275.     else-Ifstr(i) $(!NTN_InstallMode) == bind
  276.         set StartLabel = bindingadapter
  277.     else-Ifstr(i) $(!NTN_InstallMode) == configure
  278.         set CommonStatus = STATUS_REBOOT
  279.         ; set ActivateDetection = TRUE
  280.         set StartLabel = configureadapter
  281.         ;
  282.         ;   You cannot config the software component
  283.         ;
  284.         Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  285.             Debug-Output "Cannot configure the LEC driver software."
  286.             Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  287.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  288.                 Debug-Output "ShellCode error: cannot get an error string."
  289.                 goto ShellCodeError
  290.             endif
  291.             set Error = $($R0)
  292.             set from = end
  293.             set to = end
  294.             goto nonfatalinfo
  295.         endif
  296.     else
  297.         ; set ActivateDetection = TRUE
  298.         set StartLabel = installadapter
  299.         set OEM_ABANDON_OPTIONS = {}
  300.         set OEM_ABANDON_SOFTWARE = FALSE
  301.         set OEM_ABANDON_ON = TRUE
  302.     endif
  303.  
  304.  
  305.     ;===================================================
  306.     ;  Netcard Detection logic
  307.     ;
  308.     ;  Initialize use of netcard detection;
  309.     ;  Construct require global parameter variables
  310.     ;
  311.     Debug-Output "OEMSETUP.INF: =================================================="
  312.     Debug-Output "OEMSETUP.INF: STF_CWDIR is: "$(!STF_CWDIR)
  313.     Debug-Output "OEMSETUP.INF: STF_LANGUAGE is: "$(!STF_LANGUAGE)
  314.     Debug-Output "OEMSETUP.INF: Option is: "$(Option)
  315.     Debug-Output "OEMSETUP.INF: !STF_NCDETECT  is: "$(!STF_NCDETECT)
  316.     Debug-Output "OEMSETUP.INF: !STF_NCOPTION  is: "$(!STF_NCOPTION)
  317.     Debug-Output "OEMSETUP.INF: !STF_NCDETCARD is: "$(!STF_NCDETCARD)
  318.     Debug-Output "OEMSETUP.INF: !STF_NCDETINFO is: "$(!STF_NCDETINFO)
  319.     Debug-Output "OEMSETUP.INF: =================================================="
  320.  
  321.     Set DetectedCard = FALSE
  322.  
  323.     Ifstr(i) $(ActivateDetection) != TRUE
  324.         Goto $(StartLabel)
  325.     Endif
  326.     ;
  327.     ;  Set !STF_NC_PARAMS and !STF_NC_PNAMES by calling
  328.     ;    PARAM.INF!Param_BuildTypeLists.
  329.     ;   Pass it a list of the form:
  330.     ;
  331.     ;   {  { <param name>,
  332.     ;        <name of choice list var>,
  333.     ;        <name of default var> },
  334.     ;      ...
  335.     ;   }
  336.     ;
  337.     Set TypeList = {{IRQ, IRQ_List, IRQ_Level},+
  338.                     {IOADDR, IOADDR_Addr_List, IOBaseAddrValue},+
  339.                     {MEMADDR, MemBaseAddrDecList, MemBaseAddrDec},+
  340.                     {TRANSCEIVER, TranceiverValueList, TransceiverValue}}
  341.  
  342.     Debug-Output "OEMNADE2.INF: Calling Param_BuildTypeLists"
  343.     Shell $(ParamInf) Param_BuildTypeLists $(Option) $(TypeList)
  344.     Set Status = $($R0)
  345.     ifstr(i) $(Status) != STATUS_SUCCESSFUL
  346.         Goto fataldetect
  347.     Endif
  348.  
  349.     Debug-Output "OEMNADE2.INF: Calling Param_SetDefaults"
  350.     Shell $(ParamInf) Param_SetDefaults {}
  351.  
  352.     ;  Establish presentation versions of choice lists.
  353.  
  354.     Shell $(ParamInf) HexListFromDecList $(IOADDR_Addr_List)
  355.     Set IOADDR_Hex_List = $($R0)
  356.  
  357.     Shell $(UtilityInf) SortList $(IRQ_List) TRUE FALSE
  358.     Set IRQ_List = $($R0)
  359.  
  360.     ;  If this is a detected card, set the flag.
  361.  
  362.     Ifstr(i) $(!STF_NCDETECT) == YES
  363.         Ifstr(i) $(!STF_NCOPTION) == $(Option)
  364.            Set DetectedCard = TRUE
  365.            Debug-Output "OEMNADE2.INF: Setting DetectedCard to TRUE"
  366.         Endif
  367.     Endif
  368.     ;
  369.     ;  End Netcard Detection logic
  370.     ;===================================================
  371.  
  372.     Set MappedValue = 1
  373.     Ifint $(MemBaseAddrDec) == 0
  374.        Set MappedValue = 0
  375.     Endif
  376.  
  377.     Set from = $(fatal)
  378.     Set to = $(fatal)
  379.     Goto $(StartLabel)
  380.  
  381.  
  382. ;/****************************************************************************/
  383. ;/* InstallOption - install section                                          */
  384. ;/****************************************************************************/
  385.  
  386. installadapter = +
  387.  
  388.     ; First, check whether the same version of the software exists
  389.  
  390.     OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  391.  
  392.     Ifstr $(KeyProduct) != $(KeyNull)
  393.  
  394.         ; Same version already existed in the local machine
  395.         ; Popup the dialog and ask the user whether he wants to continue
  396.  
  397.         CloseRegKey $(KeyProduct)
  398.  
  399.         ifstr(i) !(NTN_RegBase) == $(ProductKeyName)
  400.  
  401.            ; Cannot Install the same software again
  402.  
  403.            Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
  404.                $(ProductVersion)
  405.  
  406.            ifint $($ShellCode) != $(!SHELL_CODE_OK)
  407.                Debug-Output "ShellCode error: cannot get an error string."
  408.                goto ShellCodeError
  409.            endif
  410.  
  411.            goto end
  412.  
  413.         else
  414.  
  415.            ; Add a new adapter card?
  416.  
  417.            Shell $(UtilityInf), CardExistedDlg
  418.  
  419.            ifint $($ShellCode) != $(!SHELL_CODE_OK)
  420.                Debug-Output "ShellCode error: cannot get an error string."
  421.                goto ShellCodeError
  422.            endif
  423.  
  424.            ifstr(i) $($R1) != "OK"
  425.                set CommonStatus = STATUS_USERCANCEL
  426.                goto end
  427.            endif
  428.            set OldVersionExisted = $(TRUE)
  429.         endif
  430.     endif
  431.  
  432.     ;===================================================
  433.     ;  Netcard Detection logic
  434.     ;
  435.     ;   If this is a detected card, query its parameters
  436.     ;   and merge them into the default list.
  437.     ;
  438.  
  439.     ;  Indicate that there are no old parameter settings.
  440.  
  441.     Set CurrParamSettings = {}
  442.  
  443.     Ifstr(i) $(DetectedCard) != TRUE
  444.         Goto adaptersetup
  445.     Endif
  446.     ;
  447.     ;   Get the detected parameters
  448.     ;
  449.     StartWait
  450.     Shell $(ParamInf) Param_QueryCard $(!STF_NCDETCARD)
  451.     EndWait
  452.     Ifstr(i) $($R0) != STATUS_SUCCESSFUL
  453.         Goto adaptersetup
  454.     Endif
  455.     ;
  456.     ;   Merge the detected values in.
  457.     ;
  458.     Set DetectedParams = $($R1)
  459.     Debug-Output "OEMNADE2.INF: Calling Param_SetDefaults to merge detected params"
  460.     Shell $(ParamInf) Param_SetDefaults $(DetectedParams)
  461.     ;
  462.     ;  End Netcard Detection logic
  463.     ;===================================================
  464.  
  465.     goto adaptersetup
  466.  
  467.  
  468. ;/****************************************************************************/
  469. ;/* InstallOption - configure section                                        */
  470. ;/****************************************************************************/
  471.  
  472. configureadapter = +
  473.  
  474.     ; Get the current values of all the parameters
  475.  
  476.     Ifstr $(KeyProduct) == $(KeyNull)
  477.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) KeyProduct
  478.         Ifstr $(KeyProduct) == $(KeyNull)
  479.             set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  480.             Debug-Output "Cannot find component product key"
  481.             goto fatalregistry
  482.         Endif
  483.     Endif
  484.  
  485.     ; Get the other parameters;  they're attached to the service parameters key
  486.  
  487.     Debug-Output "INF: Shelling to FindService"
  488.  
  489.     Shell $(UtilityInf) FindService, $(KeyProduct)
  490.     Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  491.         Debug-Output "INF: FindService shell failure"
  492.         Goto ShellCodeError
  493.     Endif
  494.     Ifstr(i) $($R0) != NO_ERROR
  495.         Debug-Output "INF: FindService Shell error: "$($R0)
  496.         Goto fatalregistry
  497.     endif
  498.  
  499.     Set KeyParameters = $($R2)
  500.  
  501.     ;  We don't need the services key, so close it.
  502.  
  503.     CloseRegKey $($R1)
  504.  
  505.     Ifstr $(KeyParameters) == $(KeyNull)
  506.         set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  507.         Debug-Output "Cannot find component service"
  508.         goto fatalregistry
  509.     endif
  510.  
  511.     set OldVersionExisted = $(TRUE)
  512.  
  513.     set ValueName = ""
  514.     set ValueData = ""
  515.     set ValueStr  = ""
  516.     set ValueList = {}
  517.  
  518.     ; Get the old values
  519.  
  520.     EnumRegValue $(KeyParameters) ValueList
  521.  
  522.     ForListDo $(ValueList)
  523.         set ValueItem = $($)
  524.         set ValueName = *($(ValueItem),1)
  525.         set ValueData = *($(ValueItem),4)
  526.         Ifstr(i) $(ValueName) == "Name"
  527.             set LecName = $(ValueData)
  528.         else-ifstr(i) $(ValueName) == "MediaType"
  529.             ifint $(ValueData) == 1
  530.                 set MediumType = 1
  531.             else
  532.                 set MediumType = 0
  533.             endif
  534.         endif
  535.  
  536.     EndForListDo
  537.  
  538.     ;  Save the settings as they were read from the Registry.
  539.  
  540.     Shell $(ParamInf) Param_SaveValues
  541.     Set CurrParamSettings = $($R0)
  542.  
  543.     ; Put up the adapter configuration dialog if necessary.
  544.     ; Note that $(CurrParamSettings) has the old known parameter values.
  545.  
  546. adaptersetup = +
  547.  
  548.     Set from = adapteroptions
  549.  
  550.     ;===================================================
  551.     ;  Netcard Detection logic
  552.     ;
  553.     ;   Check that this card's parameters can be
  554.     ;   fully detected.
  555.     ;
  556.     Shell $(ParamInf) Param_ParameterConfidence
  557.     Ifstr(i) $($R0) != STATUS_SUCCESSFUL
  558.         Debug-Output "OEMNADE2.INF: parameter confidence too low to bypass configuration"
  559.         Goto adapteroptions
  560.     Endif
  561.     ;
  562.     ;   If this is a detected card and we're in EXPRESS mode,
  563.     ;   see if the parameters as they currently exist are
  564.     ;   verifiably correct.
  565.     ;
  566.     Ifstr(i) $(DetectedCard) == TRUE
  567.         Ifstr(i) $(!STF_INSTALL_MODE) != CUSTOM
  568.             Goto adapterverify
  569.         Endif
  570.     Endif
  571.     ;
  572.     ;  End Netcard Detection logic
  573.     ;===================================================
  574.  
  575. adapteroptions = +
  576.  
  577.     ifstr(i) $(!STF_GUI_UNATTENDED) == "YES"
  578.         ifstr(i) $(!AutoNetInterfaceType) != ""
  579.             set BusInterfaceType = $(!AutoNetInterfaceType)
  580.         else
  581.             set BusInterfaceType = 1    ;ISA
  582.         endif
  583.         ifstr(i) $(!AutoNetBusNumber) != ""
  584.             set BusNumber = $(!AutoNetBusNumber)
  585.         else
  586.             set BusNumber = 0
  587.         endif
  588.         goto adapterverify
  589.     endif
  590.  
  591. ;    read-syms FileDependentDlg$(!STF_LANGUAGE)
  592.  
  593.     ifint $(OldVersionExisted) != $(TRUE)
  594.         ifstr(i) $(!NTN_InstallMode) == install
  595.             Shell $(UtilityInf) DoAskSource $(!STF_CWDDIR) $(SrcDir) NO
  596.  
  597.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  598.                 goto ShellCodeError
  599.             else-ifstr(i) $($R0) == STATUS_FAILED
  600.  
  601.                 Shell $(UtilityInf) RegistryErrorString ASK_SOURCE_FAIL
  602.  
  603.                 ifint $($ShellCode) != $(!SHELL_CODE_OK)
  604.                     goto ShellCodeError
  605.                 endif
  606.  
  607.                 set Error = $($R0)
  608.                 goto fatal
  609.             else-ifstr(i) $($R0) == STATUS_USERCANCEL
  610.                 goto successful
  611.             endif
  612.  
  613.             Set SrcDir = $($R1)
  614.  
  615.             Install Install-Helper
  616.  
  617.             ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  618.                Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  619.                ifint $($ShellCode) != $(!SHELL_CODE_OK)
  620.                    goto ShellCodeError
  621.                endif
  622.                set Error = $($R0)
  623.                goto fatal
  624.             endif
  625.  
  626.             ; Only when we install this, make sure it's event logging is enabled
  627.  
  628.             LoadLibrary "" $(!STF_WINDOWSSYSPATH)\atmcfg.dll NtLecDll
  629.  
  630.             LibraryProcedure Result $(NtLecDll) NCPARegisterEventLog
  631.  
  632.             FreeLibrary $(NtLecDll)
  633.         endif
  634.     endif
  635.  
  636.     LoadLibrary "" $(!STF_WINDOWSSYSPATH)\atmcfg.dll NtLecDll
  637.  
  638.     ; Set FLibraryErrCtl = 1
  639.  
  640.     ifstr(i) $(!NTN_InstallMode) == install
  641.  
  642.         LibraryProcedure Result $(NtLecDll) NCPAAddAdapter $(!STF_HWND)
  643.  
  644.     else-ifstr(i) $(!NTN_InstallMode) == configure
  645.  
  646.         LibraryProcedure Result $(NtLecDll) NCPAConfigAdapter $(!STF_HWND) $(LecName)
  647.  
  648.     endif
  649.  
  650.     ; Set FLibraryErrCtl = 0
  651.  
  652.     ifstr(i) $(Result) == ERROR
  653.         goto end
  654.     endif
  655.  
  656.     ifstr(i) *($(Result), 1) == "CANCEL"
  657.         set CommonStatus = STATUS_USERCANCEL
  658.         goto end
  659.     else
  660.         set Dependencies = *($(Result), 2)
  661.         set MediumType   = *($(Result), 3)
  662.  
  663.         ifstr(i) $(!NTN_InstallMode) == install
  664.             set LecName = *($(Result), 4)
  665.         endif
  666.     endif
  667.  
  668. ; Used to request the Bus type and number, but we don't need it for now - with
  669. ; only PCI cards, the system can find all the information without our help!
  670.  
  671.     ifstr(i) $(!STF_NCDETINFO) == {}
  672.         ; not detect. popup dialog.
  673.         Shell $(UtilityInf),GetBusTypeDialog,$(ProductHardware$(Option)Description) $(BusInterfaceType) $(BusNumber)
  674.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  675.             Debug-Output "ShellCode error."
  676.             goto ShellCodeError
  677.         endif
  678.  
  679.         set BusInterfaceType = $($R1)
  680.         set BusNumber        = $($R2)
  681.     else
  682.         ; use the STF_NCDETINFO information
  683.         set BusInterfaceType = *($(!STF_NCDETINFO),5)
  684.         set BusNumber = *($(!STF_NCDETINFO),6)
  685.     endif
  686.  
  687. ;    Set FLibraryErrCtl = 1
  688. ;
  689. ;    LibraryProcedure Result $(NtLecDll) NCPAAddAdapterBusInfo +
  690. ;        $(LecName) $(BusInterfaceType) $(BusNumber)
  691. ;
  692. ;    Set FLibraryErrCtl = 0
  693.  
  694. adapterverify = +
  695.  
  696.     ;===================================================
  697.     ;  Netcard Detection logic
  698.     ;
  699.     ;   If this is a detected card, attempt to validate the options
  700.     ;   If just a normal card, try to claim the resources which have
  701.     ;     changed.
  702.     ;
  703.     Ifstr(i) $(DetectedCard) != TRUE
  704.  
  705.         ;  Build the current parameter list.  If this is an installation,
  706.         ;  (indicated by the fact that the current settings list is empty)
  707.         ;  claim all the parameters; otherwise, just claim those which
  708.         ;  have changed.
  709.  
  710.         Shell $(ParamInf) Param_SaveValues
  711.         Set NewParamSettings = $($R0)
  712.         Ifstr(i) $(CurrParamSettings) == {}
  713.             Set DiffParamSettings = $(NewParamSettings)
  714.         Else
  715.             Shell $(ParamInf) Param_DiffValues $(CurrParamSettings)
  716.             Set DiffParamSettings = $($R0)
  717.         Endif
  718.  
  719.         Debug-Output "OEMNADE2.INF: Calling Param_VerifyResources"
  720.         Shell $(ParamInf) Param_VerifyResources $(DiffParamSettings)
  721.         Ifstr(i) $($R0) == STATUS_SUCCESSFUL
  722.             Debug-Output "OEMNADE2.INF: Param_VerifyResources succeeded"
  723.             Goto skipoptions
  724.         Endif
  725.     Else
  726.         Set CardVerifyIndex = $(!STF_NCDETCARD)
  727.         Debug-Output "OEMNADE2.INF: Calling Param_VerifyCard"
  728.         Shell $(ParamInf) Param_VerifyCard $(!STF_NCDETCARD)
  729.         Ifstr(i) $($R0) == STATUS_SUCCESSFUL
  730.             Debug-Output "OEMNADE2.INF: Param_VerifyCard succeeded"
  731.             Goto skipoptions
  732.         Endif
  733.     Endif
  734.     ;
  735.     ;   Give the user a chance to retry or force the options given.
  736.     ;
  737.     Set from = adapteroptions
  738.     Set to   = skipoptions
  739.     Shell $(UtilityInf),RegistryErrorString,VERIFY_WARNING
  740.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  741.         Debug-Output "ShellCode error: cannot get an error string."
  742.         goto ShellCodeError
  743.     endif
  744.     set Error = $($R0)
  745.     Goto Warning
  746.     ;
  747.     ;  End Netcard Detection logic
  748.     ;===================================================
  749.  
  750. ;
  751. ;   If installing, go create the necessary keys;
  752. ;   if configuring, they're already open.
  753. ;
  754. skipoptions =+
  755.  
  756.     ifint $(OldVersionExisted) == $(TRUE)
  757.         ifstr(i) $(!NTN_InstallMode) == configure
  758.             goto writeparameters
  759.         endif
  760.     endif
  761.     StartWait
  762.     ;
  763.     ; Add Software Component
  764.     ;
  765.     ifint $(OldVersionExisted) == $(FALSE)
  766.         ifstr(i) $(!NTN_InstallMode) == "install"
  767.  
  768.            install "Install-Option"
  769.  
  770.            ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  771.               Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  772.               ifint $($ShellCode) != $(!SHELL_CODE_OK)
  773.                   goto ShellCodeError
  774.               endif
  775.               set Error = $($R0)
  776.               goto fatal
  777.            endif
  778.         endif
  779.  
  780.         Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  781.             $(ProductSoftwareName), +
  782.             $(ProductSoftwareName), +
  783.             $(ProductSoftwareTitle), $(STF_CONTEXTINFNAME), +
  784.             $(ProductSoftwareImagePath), "kernel", "NDIS", +
  785.             {}, "", $(NetEventDLL)
  786.  
  787.         Set OEM_ABANDON_SOFTWARE = TRUE
  788.  
  789.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  790.             Debug-Output "ShellCode error"
  791.             goto ShellCodeError
  792.         endif
  793.         ;
  794.         ;   At this point:
  795.         ;     $R1 contains the product version key handle;
  796.         ;     $R2 contains the NetRules subkey handle;
  797.         ;     $R3 contains the new Services key handle; and
  798.         ;     $R4 contains the Parameters key
  799.         ;     $R5 contains the Linkage Key
  800.         ;
  801.         set RegistryErrorIndex = $($R0)
  802.         set KeyProduct      = $($R1)
  803.         set SoftNetRulesKey = $($R2)
  804.         set LinkageKey      = $($R5)
  805.         CloseRegKey $($R3)
  806.         CloseRegKey $($R4)
  807.  
  808.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  809.             EndWait
  810.             Debug-Output "Registry error: add software components"
  811.             CloseRegKey $(KeyProduct)
  812.             CloseRegKey $(SoftNetRulesKey)
  813.             CloseRegKey $(LinkageKey)
  814.             goto fatalregistry
  815.         endif
  816.  
  817.         set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  818.                            {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  819.                            {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  820.                            {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  821.                            {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  822.                            {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  823.                            {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  824.  
  825.         Shell  $(UtilityInf), AddValueList, $(KeyProduct), $(NewValueList)
  826.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  827.             Debug-Output "ShellCode error."
  828.             goto ShellCodeError
  829.         endif
  830.  
  831.         set RegistryErrorIndex = $($R0)
  832.  
  833.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  834.             EndWait
  835.             Debug-Output "Registry error: add value list."
  836.             CloseRegKey $(KeyProduct)
  837.             CloseRegKey $(SoftNetRulesKey)
  838.             CloseRegKey $(LinkageKey)
  839.             goto fatalregistry
  840.         endif
  841.  
  842.         set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
  843.                             {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  844.                             {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  845.                             {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
  846.                             {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
  847.                             {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  848.  
  849.         Shell  $(UtilityInf), AddValueList, $(SoftNetRulesKey), $(NewValueList)
  850.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  851.             Debug-Output "ShellCode error."
  852.             goto ShellCodeError
  853.         endif
  854.  
  855.         set RegistryErrorIndex = $($R0)
  856.  
  857.         CloseRegKey $(KeyProduct)
  858.         CloseRegKey $(SoftNetRulesKey)
  859.         CloseRegKey $(LinkageKey)
  860.  
  861.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  862.             EndWait
  863.             Debug-Output "Resgitry error: add value list."
  864.             CloseRegKey $(LinkageKey)
  865.             goto fatalregistry
  866.         endif
  867.     endif
  868. ;
  869. ;   Create the HARDWARE\Netcard region and its corresponding service
  870. ;
  871.     Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName)
  872.  
  873.     ifint $($R4) != -1
  874.         Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
  875.     endif
  876.  
  877.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  878.         Debug-Output "Cannot add hardware component"
  879.         goto ShellCodeError
  880.     endif
  881.  
  882.     set RegistryErrorIndex = $($R0)
  883.  
  884.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  885.         EndWait
  886.         Debug-Output "Registry error: add hardware component"
  887.         CloseRegKey $($R1)
  888.         CloseRegKey $($R2)
  889.         CloseRegKey $($R3)
  890.         goto fatalregistry
  891.     endif
  892.  
  893. ;
  894. ;   At this point:
  895. ;     $R1  Registry key variable for HARDWARE\Netcard\(n)
  896. ;     $R2  Registry key variable for HARDWARE\Netcard\(n)\\NetRules
  897. ;     $R3  Registry key handle for <service>\Parameters key
  898. ;     $R4  Adapter number assigned to adapter
  899. ;     $R5  Service name generated by combining svc name with adapter number
  900. ;
  901.     set KeyParameters = $($R3)
  902.     set KeyAdapterRules = $($R2)
  903.     set AdapterNumber = $($R4)
  904.  
  905.     set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
  906.                        {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardware$(Option)Title)},+
  907.                        {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardware$(Option)Description)},+
  908.                        {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
  909.                        {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
  910.                        {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  911.  
  912.     Shell  $(UtilityInf), AddValueList, $($R1), $(NewValueList)
  913.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  914.         Debug-Output "ShellCode error"
  915.         goto ShellCodeError
  916.     endif
  917.  
  918.     CloseRegKey $($R1)
  919.  
  920.     set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
  921.     set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  922.  
  923.     set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
  924.                         {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
  925.                         {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
  926.                         {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  927.  
  928.     Shell  $(UtilityInf), AddValueList, $(KeyAdapterRules), $(NewValueList)
  929.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  930.         Debug-Output "ShellCode error."
  931.         goto ShellCodeError
  932.     endif
  933.  
  934.     set RegistryErrorIndex = $($R0)
  935.  
  936.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  937.         EndWait
  938.         Debug-Output "Resgitry error: add value list."
  939.         CloseRegKey $(KeyParameters)
  940.         CloseRegKey $(KeyAdapterRules)
  941.         goto fatalregistry
  942.     endif
  943.  
  944.     CloseRegKey $(KeyAdapterRules)
  945.  
  946.     goto writeparameters
  947. ;
  948. ;   REQUIRED:   $(KeyParameters) contains service Parameters key handle
  949. ;
  950. writeparameters = +
  951. ;
  952. ;   Add the service dependency key
  953. ;
  954.  
  955.     OpenRegKey $(!REG_H_LOCAL) "" $(LinkageKeyName) $(MAXIMUM_ALLOWED) KeyLinkage
  956.  
  957.     Ifstr $(KeyLinkage) == $(KeyNull)
  958.         Debug-Output "Cannot find service linkage subkey"
  959.         set RegistryError = CANNOT_FIND_COMPONENT_SERVICE
  960.         goto fatalregistry
  961.     Endif
  962.  
  963.     SetRegValue $(KeyLinkage) +
  964.         {OtherDependencies, $(NoTitle), $(!REG_VT_MULTI_SZ), $(Dependencies)}
  965.  
  966.     CloseRegKey $(KeyLinkage)
  967.  
  968.     ifint $(RegLastError) != 0
  969.         Debug-Output "Failed to set OtherDependencies"
  970.         set Error = "Failed to write OtherDependencies value"
  971.         goto fatal
  972.     endif
  973.  
  974. ; Add the rest of the parameters to the Services area
  975.  
  976.     Set NewValueList = {{Name,$(NoTitle),$(!REG_VT_SZ),$(LecName)}, +
  977.         {BusType,$(NoTitle),$(!REG_VT_DWORD),$(BusInterfaceType)}, +
  978.         {BusNumber,$(NoTitle),$(!REG_VT_DWORD),$(BusNumber)}}
  979.                         
  980.     ifint $(MediumType) != 0
  981.         ; Set MediaType = Ethernet
  982.         Set NewValueList = >($(NewValueList), +
  983.             {MediaType,$(NoTitle),$(!REG_VT_DWORD),1})
  984.     else
  985.         ; Set MediaType = Token Ring
  986.         Set NewValueList = >($(NewValueList), +
  987.             {MediaType,$(NoTitle),$(!REG_VT_DWORD),2})
  988.     endif
  989.  
  990.     Shell  $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
  991.  
  992.     ifstr(i) $(!STF_GUI_UNATTENDED) == "YES"
  993.         Shell $(UtilityInf),AddDefaultNetCardParameters,$(KeyParameters)
  994.     endif
  995.  
  996.     CloseRegKey $(KeyParameters)
  997.  
  998.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  999.         Debug-Output "ShellCode error. (Add Value List)"
  1000.         goto ShellCodeError
  1001.     endif
  1002.  
  1003.     set RegistryErrorIndex = $($R0)
  1004.  
  1005.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1006.         Debug-Output "Registry error: Add value list"
  1007.         goto fatalregistry
  1008.     endif
  1009.  
  1010.     goto successful
  1011.  
  1012.  
  1013. ;/****************************************************************************/
  1014. ;/* InstallOption - bind section                                             */
  1015. ;/****************************************************************************/
  1016.  
  1017. bindingadapter = +
  1018.     set Error = "Binding: Sorry, not yet implemented."
  1019.     goto fatal
  1020.  
  1021.  
  1022. ;/****************************************************************************/
  1023. ;/* InstallOption - deinstall section                                        */
  1024. ;/****************************************************************************/
  1025.  
  1026. removeadapter = +
  1027.     Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  1028.         ; Remove Software Component
  1029.         Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  1030.             $(ProductSoftwareName)
  1031.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1032.             Debug-Output "ShellCode error"
  1033.             goto ShellCodeError
  1034.         endif
  1035.  
  1036.         set RegistryErrorIndex = $($R0)
  1037.  
  1038.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1039.             goto fatalregistry
  1040.         endif
  1041.     else
  1042.         ; Call our support routine to update the INFO file etc.
  1043.         ; We MUST do this before calling RemoveHardwareComponent, because we
  1044.         ; need to use $(!NTN_RegBase)
  1045.  
  1046.         LoadLibrary "" $(!STF_WINDOWSSYSPATH)\atmcfg.dll NtLecDll
  1047.  
  1048. ;        Set FLibraryErrCtl = 1
  1049.  
  1050.         LibraryProcedure Result $(NtLecDll) NCPARemoveAdapter +
  1051.             $(!STF_HWND) $(!NTN_RegBase)
  1052.  
  1053. ;        Set FLibraryErrCtl = 0
  1054.  
  1055.         ifstr(i) *($(Result),1) != SUCCESS
  1056.             goto end
  1057.         endif
  1058.  
  1059.         ; Before we remove the LEC, we need to update the MAAL dependencies...
  1060.  
  1061.         OpenRegKey $(!REG_H_LOCAL) "" $(LinkageKeyName) $(MAXIMUM_ALLOWED) KeyLinkage
  1062.  
  1063.         Ifstr $(KeyLinkage) == $(KeyNull)
  1064.             Debug-Output "Cannot find service linkage subkey"
  1065.             set RegistryError = CANNOT_FIND_COMPONENT_SERVICE
  1066.             goto fatalregistry
  1067.         Endif
  1068.  
  1069.         SetRegValue $(KeyLinkage) +
  1070.             {OtherDependencies, $(NoTitle), $(!REG_VT_MULTI_SZ), *($(Result), 2)}
  1071.  
  1072.         CloseRegKey $(KeyLinkage)
  1073.  
  1074.         ifint $(RegLastError) != 0
  1075.             Debug-Output "Failed to set OtherDependencies"
  1076.             set Error = "Failed to write OtherDependencies value"
  1077.             goto fatal
  1078.         endif
  1079.  
  1080.         Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  1081.             $(ProductSoftwareName), $(!NTN_RegBase)
  1082.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1083.             Debug-Output "ShellCode error"
  1084.             goto ShellCodeError
  1085.         endif
  1086.  
  1087.         set RegistryErrorIndex = $($R0)
  1088.  
  1089.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1090.             goto fatalregistry
  1091.         endif
  1092.     endif
  1093.  
  1094.     goto end
  1095.  
  1096.  
  1097. ;/****************************************************************************/
  1098. ;/* InstallOption - update section                                           */
  1099. ;/****************************************************************************/
  1100.  
  1101. UpgradeSoftware = +
  1102.     ; Upgrade software component
  1103.     ;
  1104.     OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  1105.  
  1106.     Ifstr $(KeyProduct) != $(KeyNull)
  1107.  
  1108.         install "Install-Update"
  1109.         ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  1110.             goto fatal
  1111.         endif
  1112.  
  1113.         ; Upgrade the version number
  1114.         ;
  1115.         SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  1116.         SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  1117.  
  1118.         ;
  1119.         ; do nothing for update
  1120.         ;
  1121.         CloseRegKey $(KeyProduct)
  1122.     else
  1123.         ;
  1124.         ; Cannot Open software key, goto ERROR
  1125.         ;
  1126.         goto fatalregistry
  1127.     endif
  1128.  
  1129.     goto end
  1130.  
  1131.  
  1132. ;/****************************************************************************/
  1133. ;/* InstallOption - exit routes                                              */
  1134. ;/****************************************************************************/
  1135.  
  1136. ;  Escape hatches
  1137.  
  1138. successful = +
  1139.     goto end
  1140.  
  1141. abandon = +
  1142.     ForListDo $(OEM_ABANDON_OPTIONS)
  1143.         Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  1144.             $(ProductSoftwareName), $($)
  1145.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1146.             Debug-Output "ShellCode error"
  1147.             goto ShellCodeError
  1148.         endif
  1149.  
  1150.         set RegistryErrorIndex = $($R0)
  1151.  
  1152.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1153.             goto fatalregistry
  1154.         endif
  1155.     EndForListDo
  1156.  
  1157.     Ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
  1158.         ; Remove Software Component
  1159.         Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  1160.             $(ProductSoftwareName), FALSE
  1161.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1162.             Debug-Output "ShellCode error"
  1163.             goto ShellCodeError
  1164.         endif
  1165.  
  1166.         set RegistryErrorIndex = $($R0)
  1167.  
  1168.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1169.             goto fatalregistry
  1170.         endif
  1171.     endif
  1172.  
  1173.     goto end
  1174.  
  1175. ;
  1176. ; warning display
  1177. ;
  1178. warning = +
  1179.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  1180.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1181.         goto ShellCodeError
  1182.     endif
  1183.     ifstr(i) $($R1) == "OK"
  1184.         goto $(to)
  1185.     else-ifstr(i) $($R1) == "CANCEL"
  1186.         goto $(from)
  1187.     else
  1188.         goto "end"
  1189.     endif
  1190. ;
  1191. ; non fatal error display
  1192. ;
  1193. nonfatalinfo = +
  1194.     Set Severity = STATUS
  1195.     Set CommonStatus = STATUS_USERCANCEL
  1196.     goto nonfatalmsg
  1197. nonfatal = +
  1198.     Set Severity = NONFATAL
  1199.     goto nonfatalmsg
  1200. nonfatalmsg = +
  1201.     ifstr(i) $(Error) == ""
  1202.         Set Severity = NONFATAL
  1203.         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1204.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1205.             goto ShellCodeError
  1206.         endif
  1207.         set Error = $($R0)
  1208.     endif
  1209.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  1210.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1211.         goto ShellCodeError
  1212.     endif
  1213.     ifstr(i) $($R1) == "OK"
  1214.         goto $(from)
  1215.     else
  1216.         goto "end"
  1217.     endif
  1218.  
  1219. ;
  1220. ;  Registry is broken
  1221. ;
  1222. fatalregistry = +
  1223.     Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  1224.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1225.         goto ShellCodeError
  1226.     endif
  1227.     set Error = $($R0)
  1228.     goto fatal
  1229. ;
  1230. ;  Netcard detection failure
  1231. ;
  1232. fataldetect = +
  1233.     Shell $(UtilityInf),RegistryErrorString,CANNOT_DETECT
  1234.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1235.         Debug-Output "ShellCode error: cannot get an error string."
  1236.         goto ShellCodeError
  1237.     endif
  1238.     set Error = $($R0)
  1239.     Goto fatal
  1240. ;
  1241. ; fatal error display
  1242. ;
  1243. fatal = +
  1244.     ifstr(i) $(Error) == ""
  1245.         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1246.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1247.             goto ShellCodeError
  1248.         endif
  1249.         set Error = $($R0)
  1250.     endif
  1251.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  1252.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1253.         goto ShellCodeError
  1254.     endif
  1255.  
  1256.     goto setfailed
  1257.  
  1258. ;
  1259. ;  Shelling error
  1260. ;
  1261. ShellCodeError = +
  1262.     set DlgType      = "MessageBox"
  1263.     set STF_MB_TITLE = $(ShellCodeErrorTitle)
  1264.     set STF_MB_TEXT  = $(ShellCodeErrorText)
  1265.     set STF_MB_TYPE  = 1
  1266.     set STF_MB_ICON  = 3
  1267.     set STF_MB_DEF   = 1
  1268.     ui start "Error Message"
  1269.     goto setfailed
  1270.  
  1271. setfailed = +
  1272.     set CommonStatus = STATUS_FAILED
  1273.     ;
  1274.     ; if OEM_ABANDON_ON == TRUE, then remove the registry entries
  1275.     ;
  1276.     ifstr(i) $(OEM_ABANDON_ON) == TRUE
  1277.         set OEM_ABANDON_ON = FALSE
  1278.         goto abandon
  1279.     endif
  1280.     goto end
  1281.  
  1282. end = +
  1283.     ifstr $(NtLecDll) != $(KeyNull)
  1284.         FreeLibrary $(NtLecDll)
  1285.     endif
  1286.  
  1287.     EndWait
  1288.  
  1289.     goto term
  1290.  
  1291. term = +
  1292.  
  1293.     Return $(CommonStatus)
  1294.  
  1295.  
  1296. ;/****************************************************************************/
  1297. ;/*                                                                          */
  1298. ;/* Mandatory section - Source Media Descriptions                            */
  1299. ;/*                                                                          */
  1300. ;/****************************************************************************/
  1301.  
  1302. [Source Media Descriptions]
  1303. ;    1 = "Madge ATM Drivers - NDIS3", TAGFILE = disk4
  1304.      1 = "Windows NT DRVLIB"
  1305.  
  1306. [Signature]
  1307.     FileType = MICROSOFT_DRVLIB_FILE
  1308. [GetSignature]
  1309.     read-syms Signature
  1310.     return $(FileType)
  1311.  
  1312. ;/****************************************************************************/
  1313. ;/*                                                                          */
  1314. ;/* Install sections                                                         */
  1315. ;/*                                                                          */
  1316. ;/****************************************************************************/
  1317.  
  1318. [Files-Helper]
  1319.     1, ATMCFG.DLL
  1320.     1, ATMCFG.HLP
  1321.  
  1322.  
  1323. [Files-LEC]
  1324.     1, AMUX.SYS
  1325.     1, COL25.SYS
  1326.     1, COL155.SYS
  1327.     1, NTLEC.SYS
  1328.  
  1329. [Install-Helper]
  1330.     set STF_VITAL = ""
  1331.     AddSectionFilesToCopyList Files-Helper $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1332.     set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1333.     CopyFilesInCopyList
  1334.     Exit
  1335.  
  1336.  
  1337. [Install-Option]
  1338.     set STF_VITAL = ""
  1339.     ifstr(i) $(AddCopy) == "YES"
  1340.         AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1341.     endif
  1342.     ifstr(i) $(DoCopy) == "YES"
  1343.        set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1344.        CopyFilesInCopyList
  1345.     endif
  1346.     exit
  1347.  
  1348.  
  1349. [Install-Update]
  1350.     set STF_VITAL        = ""
  1351.     set STF_OVERWRITE    = "VERIFYSOURCEOLDER"
  1352.     ;set STF_VERSION     = "YES"
  1353.     AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1354.     AddSectionFilesToCopyList Files-Helper    $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1355.     CopyFilesInCopyList
  1356.     exit
  1357.  
  1358.  
  1359. ;/****************************************************************************/
  1360. ;/*                                                                          */
  1361. ;/* Language dependent sections                                              */
  1362. ;/*                                                                          */
  1363. ;/****************************************************************************/
  1364.  
  1365. [OptionsTextENG]
  1366.     LEC = "Madge ATM LAN Emulation Client"
  1367.  
  1368.  
  1369. [FileConstantsENG]
  1370.     
  1371.     ; General setup title string
  1372.  
  1373.     FunctionTitle = "Madge NDIS3 LEC Configuration"
  1374.  
  1375.     ; Software text strings
  1376.  
  1377.     ProductSoftwareTitle          = "Madge NDIS3 LEC Driver"
  1378.     ProductSoftwareDescription    = "Madge NDIS3 LEC Driver for ATM"
  1379.  
  1380.     ; Hardware text strings
  1381.  
  1382.     ProductHardwareLECTitle       = "Madge Lan Emulation Client"
  1383.     ProductHardwareLECDescription = "Madge Lan Emulation Client for ATM"
  1384.  
  1385.     ; "Copy files" dialog box text strings
  1386.  
  1387.     ProCaption   = "Windows NT Setup"
  1388.     ProCancel    = "Cancel"
  1389.     ProCancelMsg = "Windows NT Networking is not correctly installed."+
  1390.                    "Are you sure you want to cancel copying files?"
  1391.     ProCancelCap = "Network Setup Message"
  1392.     ProText1     = "Copying:"
  1393.     ProText2     = "To:"
  1394.  
  1395.     ; Shell code error message box text strings
  1396.  
  1397.     ShellCodeErrorTitle = "Error: "$(FunctionTitle)
  1398.     ShellCodeErrorText  = "Shell Code Error"
  1399.  
  1400.  
  1401. [DialogConstantsENG]
  1402.     Cancel   = "Cancel"
  1403.     Continue = "Continue"
  1404.     Exit     = "Cancel"
  1405.     Help     = "Help"
  1406.     Ok       = "Ok"
  1407.  
  1408.  
  1409. ;/****************************************************************************/
  1410. ;/*                                                                          */
  1411. ;/* End of file                                                              */
  1412. ;/*                                                                          */
  1413. ;/****************************************************************************/
  1414.